/**
 *  fileName:testchangearr
 *  time:2021/1/18
 *  todo:$END$
 */

let TplObj = {
  tpl1: [
    { width: '1680', height: '320', x: '0', y: '0' }
  ],
  tpl2: [
    { width: '816', height: '320', x: '0', y: '0' },
    { width: '816', height: '320', x: '864', y: '0' }
  ],
  tpl3: [
    { width: '528', height: '296', x: '0', y: '0' },
    { width: '528', height: '296', x: '576', y: '0' },
    { width: '528', height: '296', x: '1152', y: '0' }
  ],
  tpl4: [
    { width: '384', height: '216', x: '0', y: '0' },
    { width: '384', height: '216', x: '432', y: '0' },
    { width: '384', height: '216', x: '864', y: '0' },
    { width: '384', height: '216', x: '1296', y: '0' }
  ],
  tpl5: [
    { width: '240', height: '240', x: '0', y: '0' },
    { width: '240', height: '240', x: '288', y: '0' },
    { width: '240', height: '240', x: '576', y: '0' },
    { width: '240', height: '240', x: '864', y: '0' },
    { width: '240', height: '240', x: '1152', y: '0' },
    { width: '240', height: '240', x: '1440', y: '0' }
  ],
  tpl6: [
    { width: '168', height: '46', x: '0', y: '0' },
    { width: '168', height: '46', x: '216', y: '0' },
    { width: '168', height: '46', x: '432', y: '0' },
    { width: '168', height: '46', x: '648', y: '0' },
    { width: '168', height: '46', x: '864', y: '0' },
    { width: '168', height: '46', x: '1080', y: '0' },
    { width: '168', height: '46', x: '1296', y: '0' },
    { width: '168', height: '46', x: '1512', y: '0' }
  ],
  tpl7: [
    { width: '168', height: '100', x: '0', y: '0' },
    { width: '168', height: '100', x: '216', y: '0' },
    { width: '168', height: '100', x: '432', y: '0' },
    { width: '168', height: '100', x: '648', y: '0' },
    { width: '168', height: '100', x: '864', y: '0' },
    { width: '168', height: '100', x: '1080', y: '0' },
    { width: '168', height: '100', x: '1296', y: '0' },
    { width: '168', height: '100', x: '1512', y: '0' }
  ],
  tpl8: [
    { width: '240', height: '360', x: '0', y: '0' },
    { width: '240', height: '360', x: '288', y: '0' },
    { width: '240', height: '360', x: '576', y: '0' },
    { width: '240', height: '360', x: '864', y: '0' },
    { width: '240', height: '360', x: '1152', y: '0' },
    { width: '240', height: '360', x: '1440', y: '0' }
  ],
  tpl9: [
    { width: '816', height: '480', x: '0', y: '0' },
    { width: '384', height: '216', x: '864', y: '0' },
    { width: '384', height: '216', x: '1296', y: '0' },
    { width: '384', height: '216', x: '864', y: '264' },
    { width: '384', height: '216', x: '1296', y: '264' }
  ],
  tpl10: [
    { width: '384', height: '480', x: '0', y: '0' },
    { width: '384', height: '216', x: '432', y: '0' },
    { width: '384', height: '216', x: '864', y: '0' },
    { width: '384', height: '216', x: '1296', y: '0' },
    { width: '384', height: '216', x: '432', y: '264' },
    { width: '384', height: '216', x: '864', y: '264' },
    { width: '384', height: '216', x: '1296', y: '264' }
  ],
  tpl11: [
    { width: '384', height: '548', x: '0', y: '0' },
    { width: '384', height: '548', x: '432', y: '0' },
    { width: '384', height: '548', x: '864', y: '0' },
    { width: '384', height: '548', x: '1296', y: '0' }
  ],
  tpl12: [
    { width: '816', height: '320', x: '0', y: '0' },
    { width: '816', height: '320', x: '864', y: '0' },
    { width: '528', height: '296', x: '0', y: '368' },
    { width: '528', height: '296', x: '576', y: '368' },
    { width: '528', height: '296', x: '1152', y: '368' }
  ],
  tpl13: [
    { width: '816', height: '320', x: '0', y: '0' },
    { width: '816', height: '320', x: '864', y: '0' },
    { width: '384', height: '216', x: '0', y: '368' },
    { width: '384', height: '216', x: '432', y: '368' },
    { width: '384', height: '216', x: '864', y: '368' },
    { width: '384', height: '216', x: '1296', y: '368' }
  ],
  tpl14: [
    { width: '384', height: '216', x: '0', y: '0' },
    { width: '384', height: '216', x: '432', y: '0' },
    { width: '384', height: '216', x: '864', y: '0' },
    { width: '384', height: '216', x: '1296', y: '0' },
    { width: '816', height: '320', x: '0', y: '264' },
    { width: '816', height: '320', x: '864', y: '264' }
  ],
  tpl15: [
    { width: '528', height: '296', x: '0', y: '0' },
    { width: '528', height: '296', x: '576', y: '0' },
    { width: '528', height: '296', x: '1152', y: '0' },
    { width: '384', height: '216', x: '0', y: '344' },
    { width: '384', height: '216', x: '432', y: '344' },
    { width: '384', height: '216', x: '864', y: '344' },
    { width: '384', height: '216', x: '1296', y: '344' }
  ],
  tpl16: [
    { width: '816', height: '480', x: '0', y: '0' },
    { width: '384', height: '480', x: '864', y: '0' },
    { width: '384', height: '480', x: '1296', y: '0' },
    { width: '384', height: '216', x: '0', y: '528' },
    { width: '384', height: '216', x: '432', y: '528' },
    { width: '384', height: '216', x: '864', y: '528' },
    { width: '384', height: '216', x: '1296', y: '528' }
  ],
  tpl17: [
    { width: '816', height: '480', x: '0', y: '0' },
    { width: '384', height: '216', x: '864', y: '0' },
    { width: '384', height: '216', x: '1296', y: '0' },
    { width: '384', height: '216', x: '864', y: '264' },
    { width: '384', height: '216', x: '1296', y: '264' },
    { width: '384', height: '216', x: '0', y: '528' },
    { width: '384', height: '216', x: '432', y: '528' },
    { width: '384', height: '216', x: '864', y: '528' },
    { width: '384', height: '216', x: '1296', y: '528' }
  ],
  tpl18: [
    { width: '816', height: '480', x: '0', y: '0' },
    { width: '384', height: '480', x: '864', y: '0' },
    { width: '384', height: '480', x: '1296', y: '0' },
    { width: '816', height: '216', x: '0', y: '528' },
    { width: '816', height: '216', x: '864', y: '528' }
  ],
  tpl19: [
    { width: '816', height: '480', x: '0', y: '0' },
    { width: '816', height: '480', x: '864', y: '0' },
    { width: '384', height: '216', x: '0', y: '528' },
    { width: '384', height: '216', x: '432', y: '528' },
    { width: '384', height: '216', x: '864', y: '528' },
    { width: '384', height: '216', x: '1296', y: '528' }
  ],
  tpl20: [
    { width: '816', height: '480', x: '0', y: '0' },
    { width: '816', height: '480', x: '864', y: '0' },
    { width: '384', height: '216', x: '0', y: '528' },
    { width: '384', height: '216', x: '432', y: '528' },
    { width: '384', height: '216', x: '864', y: '528' },
    { width: '384', height: '216', x: '1296', y: '528' },
    { width: '168', height: '96', x: '0', y: '792' },
    { width: '168', height: '96', x: '216', y: '792' },
    { width: '168', height: '96', x: '432', y: '792' },
    { width: '168', height: '96', x: '648', y: '792' },
    { width: '168', height: '96', x: '864', y: '792' },
    { width: '168', height: '96', x: '1080', y: '792' },
    { width: '168', height: '96', x: '1296', y: '792' },
    { width: '168', height: '96', x: '1512', y: '792' }
  ],
  tpl21: [
    { width: '528', height: '296', x: '0', y: '0' },
    { width: '528', height: '296', x: '576', y: '0' },
    { width: '528', height: '296', x: '1152', y: '0' },
    { width: '240', height: '360', x: '0', y: '344' },
    { width: '240', height: '360', x: '288', y: '344' },
    { width: '240', height: '360', x: '576', y: '344' },
    { width: '240', height: '360', x: '864', y: '344' },
    { width: '240', height: '360', x: '1152', y: '344' },
    { width: '240', height: '360', x: '1440', y: '344' }
  ],
  tpl22: [
    { width: '816', height: '480', x: '0', y: '0' },
    { width: '384', height: '216', x: '864', y: '0' },
    { width: '384', height: '216', x: '1296', y: '0' },
    { width: '384', height: '216', x: '864', y: '264' },
    { width: '384', height: '216', x: '1296', y: '264' },
    { width: '240', height: '216', x: '0', y: '528' },
    { width: '240', height: '216', x: '288', y: '528' },
    { width: '240', height: '216', x: '576', y: '528' },
    { width: '384', height: '216', x: '864', y: '528' },
    { width: '384', height: '216', x: '1296', y: '528' }
  ],
  tpl23: [
    { width: '816', height: '240', x: '0', y: '0' },
    { width: '816', height: '240', x: '864', y: '0' }
  ],
  tpl24: [
    { width: '168', height: '168', x: '0', y: '0' },
    { width: '168', height: '168', x: '216', y: '0' },
    { width: '168', height: '168', x: '432', y: '0' },
    { width: '168', height: '168', x: '648', y: '0' },
    { width: '168', height: '168', x: '864', y: '0' },
    { width: '168', height: '168', x: '1080', y: '0' },
    { width: '168', height: '168', x: '1296', y: '0' },
    { width: '168', height: '168', x: '1512', y: '0' }
  ],
  tpl25: [
    { width: '240', height: '162', x: '0', y: '0' },
    { width: '240', height: '162', x: '288', y: '0' },
    { width: '240', height: '162', x: '576', y: '0' },
    { width: '240', height: '162', x: '864', y: '0' },
    { width: '240', height: '162', x: '1152', y: '0' },
    { width: '240', height: '162', x: '1440', y: '0' }
  ],
  tpl26: [
    { width: '528', height: '240', x: '0', y: '0' },
    { width: '528', height: '240', x: '576', y: '0' },
    { width: '528', height: '240', x: '1152', y: '0' }
  ],
  tpl27: [
    { width: '528', height: '240', x: '0', y: '0' },
    { width: '528', height: '240', x: '576', y: '0' },
    { width: '528', height: '240', x: '1152', y: '0' },
    { width: '240', height: '240', x: '0', y: '288' },
    { width: '240', height: '240', x: '288', y: '288' },
    { width: '528', height: '240', x: '576', y: '288' },
    { width: '528', height: '240', x: '1152', y: '288' }
  ],
  tpl28: [
    { width: '240', height: '162', x: '0', y: '0' },
    { width: '1392', height: '162', x: '288', y: '0' }
  ],
  tpl29: [
    { width: '528', height: '480', x: '0', y: '0' },
    { width: '528', height: '216', x: '576', y: '0' },
    { width: '528', height: '216', x: '1152', y: '0' },
    { width: '528', height: '216', x: '576', y: '264' },
    { width: '528', height: '216', x: '1152', y: '264' },
    { width: '240', height: '162', x: '0', y: '528' },
    { width: '240', height: '162', x: '288', y: '528' },
    { width: '240', height: '162', x: '576', y: '528' },
    { width: '240', height: '162', x: '864', y: '528' },
    { width: '240', height: '162', x: '1152', y: '528' },
    { width: '240', height: '162', x: '1440', y: '528' }
  ],
  tpl30: [
    { width: '240', height: '70', x: '0', y: '0' },
    { width: '240', height: '70', x: '288', y: '0' },
    { width: '240', height: '70', x: '576', y: '0' },
    { width: '240', height: '70', x: '864', y: '0' },
    { width: '240', height: '70', x: '1152', y: '0' },
    { width: '240', height: '70', x: '1440', y: '0' },
    { width: '240', height: '240', x: '0', y: '82' },
    { width: '240', height: '240', x: '288', y: '82' },
    { width: '240', height: '240', x: '576', y: '82' },
    { width: '240', height: '240', x: '864', y: '82' },
    { width: '240', height: '240', x: '1152', y: '82' },
    { width: '240', height: '240', x: '1440', y: '82' }
  ],
  tpl31: [
    { width: '816', height: '480', x: '0', y: '0' },
    { width: '384', height: '480', x: '864', y: '0' },
    { width: '370', height: '93', x: '871', y: '69' },
    { width: '370', height: '93', x: '871', y: '174' },
    { width: '370', height: '93', x: '871', y: '279' },
    { width: '370', height: '93', x: '871', y: '384' },
    { width: '384', height: '216', x: '1296', y: '0' },
    { width: '384', height: '216', x: '1296', y: '264' },
    { width: '384', height: '216', x: '0', y: '528' },
    { width: '384', height: '216', x: '432', y: '528' },
    { width: '384', height: '216', x: '864', y: '528' },
    { width: '384', height: '216', x: '1296', y: '528' }
  ],
  tpl32: [
    { width: '1068', height: '600', x: '0', y: '0' },
    { width: '600', height: '120', x: '1080', y: '0' },
    { width: '600', height: '120', x: '1080', y: '120' },
    { width: '600', height: '120', x: '1080', y: '240' },
    { width: '600', height: '120', x: '1080', y: '360' },
    { width: '600', height: '120', x: '1080', y: '480' }
  ]
}

let obj = {}
for (const tplObjKey in TplObj) {
  let arr = TplObj[tplObjKey]
  arr.map((item,i) => {
    item.width = Number(item.width)
    item.height = Number(item.height)
    item.x = Number(item.x)
    item.y = Number(item.y)
    item.xall = item.x + item.width
    item.yall = item.y + item.height
    item.index = i
  })
  // for (let i = 0; i < arr.length; i++) {
  //   arr[i].max_height = Number(arr[i].height) + Number(arr[i].y)
  // }
}
// console.log('TplObj:',TplObj)
console.log('TplObj:',JSON.stringify(TplObj))
// for (const tplObjKey in TplObj) {
//   let arr = TplObj[tplObjKey]
//   let max_height = arr[0].max_height
//   for (let i = 0; i < arr.length; i++) {
//     max_height = Math.max(max_height,arr[i].max_height)
//   }
//   obj[tplObjKey] = max_height
// }
// console.log('obj:',obj)
